﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Phorest.Voucher.Models;

namespace Phorest.Voucher.Tests.Intergration
{
    [TestClass]
    public class VoucherApiTests
    {
        [TestMethod]
        public void CreateVoucher_Valid_ExpectSuccess()
        {
            // Arrange
            var apiClient = new VoucherApi("http://memento-dev.phorest.com", "test@phorest.com", "Testtest1");
            var request = new VoucherRequest
            {
                IssueDate = DateTime.Now,
                ExpiryDate = DateTime.Now.AddHours(1),
                OriginalBalance = 1,
                Branch = new Branch
                {
                    BusinessId = "3Evn8Qqw6pVY4iScdZXWBA",
                    BranchId = "nPpLa0UY4UO5dn68TpPsiA"
                }
            };

            // Act
            var result = apiClient.CreateVoucher(request);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Success);
        }
    }
}
